﻿/* 1. Write a program that prints all the numbers from 1 to N. */

using System;

public class FirstNNumbers
{
    public static void Main()
    {
        int firstNumber = 1;
        int lastNumber;
        sbyte sign = 1;

        do
        {
            Console.Clear();
            Console.Write("First number = ");
            if (int.TryParse(Console.ReadLine(), out firstNumber))
                break;
        } while (true);

        do
        {
            Console.Clear();
            Console.Write("First number = {0}\nLast number = ", firstNumber);
            if (int.TryParse(Console.ReadLine(), out lastNumber))
                break;
        } while (true);

        if (lastNumber < firstNumber)
        {
            sign = -1;
            lastNumber = firstNumber - lastNumber;
        }
        else
            lastNumber -= firstNumber;

        Console.Write(firstNumber);
        for (int i = 1; i <= lastNumber; i++)
            Console.Write(", {0}", firstNumber + i * sign);

        Console.WriteLine();
    }
}